<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <title>登录页面</title>
    <!-- stylesheets -->
  	<link rel="stylesheet" href="<%=basePath%>component/loginPanel/slidingLogin/css/style.css" type="text/css" media="screen" />
  	<link rel="stylesheet" href="<%=basePath%>component/loginPanel/slidingLogin/css/slide.css" type="text/css" media="screen" />
  	<!-- PNG FIX for IE6 -->
  	<!-- http://24ways.org/2007/supersleight-transparent-png-in-ie6 -->
	<!--[if lte IE 6]>
		<script type="text/javascript" src="js/pngfix/supersleight-min.js"></script>
	<![endif]-->
    <!-- jQuery - the core  -->
	<script src="<%=basePath%>component/loginPanel/slidingLogin/js/jquery-1.3.2.min.js" type="text/javascript"></script>
	<!-- Sliding effect -->
	<script src="<%=basePath%>component/loginPanel/slidingLogin/js/slide.js" type="text/javascript"></script>
	<!-- login validate dwr  -->    
    <script type="text/javascript" src="<%=basePath%>dwrsystem/engine.js"></script>
	<script type="text/javascript" src="<%=basePath%>dwrsystem/interface/validateLogin.js"></script>
	
	<!--窗口代码 -->	
	<script type="text/javascript" src="<%=basePath%>component/windows.js"></script>
	
<script type="text/javascript">
function validaterForm(){
	var usernameValue = $("#username").val();
	var passwordValue = $("#password").val();
	if($.trim(usernameValue)==''){myAlert('请填写用户名');document.getElementById("username").focus();return ;}
	if($.trim(passwordValue)==''){myAlert('请填写密码');document.getElementById("password").focus();return ;}
	waitingWindow();
	validateLogin.validate(usernameValue,passwordValue,'<%=request.getRemoteAddr()%>',
		function(data){
			if(data == 0){
				myAlert('用户名或者密码错误');
				return false;
			}else if(data == -1){
				myAlert('登陆工作站地址不正确');
				return false;
			}else{
				document.forms[0].submit();
			}
		});
}
function initBody(){
	$("#toggle a").toggle();
	$("div#panel").slideDown("slow");
	
	$("#username").keydown(function(event){if(event.keyCode==13){validaterForm(); }});
	$("#password").keydown(function(event){if(event.keyCode==13){validaterForm(); }});  
	$("#submitForm").keydown(function(event){if(event.keyCode==13){validaterForm(); }});
}
</script>
  </head>
  
<body onload="initBody()" >
<div id="toppanel">
	<div id="panel">
		<div class="content clearfix">
			<div class="left">
				<h1>欢迎进入平台系统</h1>
				<h2>平台简介</h2>		
				<p class="grey">本系统管理版本号码v0.2，如果需要请联系开发团队，谢谢使用。您的支持是我们进步的最大动力。</p>
				<h2>联系我们:</h2>
				<p class="grey">TEL: 13717790330</p>
			</div>
			<div class="left">
				<!-- Login Form -->
				<form class="clearfix" action="<%=basePath%>system/LoginAction!login.action" method="post">
					<h1>用户登录</h1>
					<label class="grey" for="log">用户名:</label>
					<input class="field" type="text" name="username" id="username" value="" maxlength="20" size="23" /><span style="color:red">*</span>
					<label class="grey" for="pwd">密码:</label>
					<input class="field" type="password" name="password" id="password" maxlength="20" size="23" /><span style="color:red">*</span>
		           	<label>
		           	<!-- 
		           	<input name="rememberme" id="rememberme" type="checkbox" checked="checked" value="forever" /> &nbsp;记住我
		           	 -->
		           	</label>
		      			<div class="clear"></div>
					<input type="button" id="submitForm" name="submitForm" value="登录系统" class="bt_login"  onclick="javascript:validaterForm()"/>
					<a class="lost-pwd" href="javascript:function(){};">忘记密码?</a>
				</form>
			</div>
			<div class="left right">
				<img src="<%=basePath%>theme/images/sinologo.png" alt="logo"/>
			</div>
		</div>
	</div>
	<div class="tab">
		<ul class="login">
			<li class="left">&nbsp;</li>
			<li>&nbsp;</li>
			<li class="sep">|</li>
			<li id="toggle">
				<a id="open" class="open">登录系统</a>
				<a id="close" style="display: none;" class="close">关闭面板</a>			
			</li>
			<li class="right">&nbsp;</li>
		</ul> 
	</div>
</div> 

<div id="container">
	<div id="content" style="padding-top:100px;">
	</div>
</div>
</body>
</html>